package com.eric.rabbitmq.topic;

import com.eric.rabbitmq.config.RabbitTopicConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName TopicSender.java
 * @Description TODO
 * @createTime 2020年07月29日 18:53:00
 */
@Component
public class TopicSender {

    @Autowired
    AmqpTemplate amqpTemplate;

    public void send(String object){
        amqpTemplate.convertAndSend(RabbitTopicConfig.TOPIC_EXCHANGE,RabbitTopicConfig.TOPIC_ORDER,object);
    }

    public void send2(String object){
        amqpTemplate.convertAndSend(RabbitTopicConfig.TOPIC_EXCHANGE,RabbitTopicConfig.TOPIC_PRODUCT,object);
    }

}
